/* eslint-disable react/react-in-jsx-scope */
import React, { Component } from 'react';
import {
    Image
} from 'react-native';
import { Actions } from 'react-native-router-flux';
import { Container } from '../component'
import imgBgSplash from '../images/splash.jpeg';

export default class Splash extends Component {

    componentDidMount() {
        this.timer = setTimeout(() => {
            Actions.replace('home')
        }, 3000)
    }

    componentWillUnmount() {
        this.timer && clearTimeout(this.timer)
    }

    render() {
        return (
            <Container>
                <Image
                    resizeMode={'cover'}
                    source={imgBgSplash}
                    style={{ width: '100%', height: '100%', }}
                />
            </Container>
        )
    }

}